﻿using Corina.Common;
using Corina.DataContext.Master;
using Corina.Datamodel.Base;
using Corina.Datamodel.DataObject;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace Corina.Webservice.Lantern
{
    /// <summary>
    /// Summary description for Measure
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
    // [System.Web.Script.Services.ScriptService]
    public class Measure : WebserviceBase
    {
        [WebMethod]
        public ResultInfo GetAllMeasureItems(string account, string password, string deviceSn, int kindId,int subid, string name, string tester, string condition, int index, int size)
        {
            List<QueryCondition> conditions = JsonHelper.Parse<List<QueryCondition>>(condition);
            return GetInstance<DeviceMeasureMaster>().GetAllItems(account, password, deviceSn, kindId, subid, name, tester, conditions, index, size);
        }

        [WebMethod]
        public ResultInfo GetAllSpecimenItems(string account, string password, string code, string name, string deviceSn, int index, int size)
        {
            return GetInstance<SpecimenMaster>().GetAllItems(account, password, code, name, deviceSn, index, size);
        }

        [WebMethod]
        public ResultInfo InsertSpecimen(string account, string password, string code, string name,string deviceSn)
        {
            return GetInstance<SpecimenMaster>().Insert(account, password, code, name, deviceSn);
        }
    }
}
